From d2a085d07ca19392412bb02c06c3c532c31ed8b4 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 17 Nov 2005 13:02:19 +0100 Subject: [PATCH] Fix event_pending() macro to match the assembly-language checks in entry.S. This will avoid a hard-to-debug loop that we found ourselves in recently, involving hypercall_preempt_check() spuriously returning TRUE, but no event getting propagated to the guest (since mask != 0). Signed-off-by: Keir Fraser --- xen/include/xen/event.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h index e8a8bc2b5b..a8632eaf09 100644 --- a/xen/include/xen/event.h +++ b/xen/include/xen/event.h @@ -60,7 +60,7 @@ extern void send_guest_pirq(struct domain *d, int pirq); /* Note: Bitwise operations result in fast code with no branches. */ #define event_pending(v) \ - ((v)->vcpu_info->evtchn_upcall_pending & \ - ~(v)->vcpu_info->evtchn_upcall_mask) + (!!(v)->vcpu_info->evtchn_upcall_pending & \ + !(v)->vcpu_info->evtchn_upcall_mask) #endif /* __XEN_EVENT_H__ */ -- 2.30.2